package com.ruoyi.recycle.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.recycle.domain.TrainVideo;
import com.ruoyi.recycle.mapper.TrainVideoMapper;
import com.ruoyi.recycle.service.ITrainVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 培训视频Service业务层处理
 *
 * @author Wubk
 * @date 2022-05-22
 */
@Service
public class TrainVideoServiceImpl extends ServiceImpl<TrainVideoMapper, TrainVideo> implements ITrainVideoService {
    @Autowired
    private TrainVideoMapper trainVideoMapper;

    /**
     * 查询培训视频
     *
     * @param id 培训视频主键
     * @return 培训视频
     */
    @Override
    public TrainVideo selectTrainVideoById(Long id) {
        return trainVideoMapper.selectTrainVideoById(id);
    }

    /**
     * 查询培训视频列表
     *
     * @param trainVideo 培训视频
     * @return 培训视频
     */
    @Override
    public List<TrainVideo> selectTrainVideoList(TrainVideo trainVideo) {
        return trainVideoMapper.selectTrainVideoList(trainVideo);
    }

    /**
     * 新增培训视频
     *
     * @param trainVideo 培训视频
     * @return 结果
     */
    @Override
    public int insertTrainVideo(TrainVideo trainVideo) {
        return trainVideoMapper.insertTrainVideo(trainVideo);
    }

    /**
     * 修改培训视频
     *
     * @param trainVideo 培训视频
     * @return 结果
     */
    @Override
    public int updateTrainVideo(TrainVideo trainVideo) {
        return trainVideoMapper.updateTrainVideo(trainVideo);
    }

    /**
     * 批量删除培训视频
     *
     * @param ids 需要删除的培训视频主键
     * @return 结果
     */
    @Override
    public int deleteTrainVideoByIds(Long[] ids) {
        return trainVideoMapper.deleteTrainVideoByIds(ids);
    }

    /**
     * 删除培训视频信息
     *
     * @param id 培训视频主键
     * @return 结果
     */
    @Override
    public int deleteTrainVideoById(Long id) {
        return trainVideoMapper.deleteTrainVideoById(id);
    }
}
